# -*- encoding: utf-8 -*-
# 
# Lúcuma
# Copyright © 2008 Diego Escalante Urrelo  <diegoe@gnome.org>
# 
# Licensed under the GNU General Public License Version 2
# 
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
# 
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
# 
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor
# Boston, MA  02110-1301, USA.
# 

from django.conf.urls.defaults import patterns, include
from settings import MEDIA_ROOT

from django.contrib import admin
admin.autodiscover()

urlpatterns = patterns('',
    # Main site
    (r'^$', 'lucuma.site.views.index'),
    (r'^lucuma/', 'lucuma.site.views.index'),
    
    # Apps
    (r'^personas/', include('lucuma.personas.urls')),
    (r'^tasks/', include('lucuma.tasks.urls')),
    (r'^notes/', include('lucuma.notes.urls')),
    (r'^tags/', include('lucuma.tags.urls')),
    (r'^comments/', include('lucuma.comments.urls')),
    (r'^projects/', include('lucuma.projects.urls')),

    # Auth
	(r'^logout/$', 'lucuma.personas.actions.logout'),
	(r'^login/post/$', 'lucuma.personas.actions.login_ajax'),
    (r'^join/$', 'lucuma.personas.views.add'),
    (r'^personas/add/post/$', 'lucuma.personas.actions.add'),

    # Other stuff
    (r'^admin/(.*)', admin.site.root),
    (r'^static/(?P<path>.*)$', 'django.views.static.serve', {'document_root': MEDIA_ROOT}),
)
